package com.dw.dwdzcommerce.tools.uiView.smartMenu;

import com.dw.dwdzcommerce.R;

import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class TextLayout extends LinearLayout {

	private String text;
	private TextView tv;
	private ImageView mArrow;

	public TextLayout(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
//		init();
	}

	public TextLayout(Context context, AttributeSet attrs) {
		super(context, attrs);
//		init();
	}

	public TextLayout(Context context) {
		super(context);
//		init();
	}

	public void init()
	{
		View inflateView = LayoutInflater.from(getContext()).inflate(R.layout.item_classify_btn_layout, TextLayout.this,
				false);
		initView(inflateView);
		this.addView(inflateView, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));

	}

	private void initView(View inflateView)
	{
		tv = (TextView) inflateView.findViewById(R.id.item_classify_btn);
		tv.getText().toString();
		mArrow=(ImageView) inflateView.findViewById(R.id.item_classify_arrow);
	}

	public ImageView getArrow(){
		return mArrow;
	}
	
	public String getText()
	{
		return tv.getText().toString();
	}

	public void setText(String text)
	{
		tv.setText(text);
	}

	public void setTextSize(float size)
	{
		tv.setTextSize(size);
	}

	public void setTextColor(String color)
	{
		tv.setTextColor(Color.parseColor(color));
	}

	public void setTextColor(int color)
	{
		tv.setTextColor(color);
	}
}
